package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * App用户设备实体类
 * 
 * @author mark
 * @date 2025-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("app_device")
@Schema(name = "AppDevice", description = "app用户设备")
public class AppDevice {

    @Schema(description = "设备ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "用户ID")
    @TableField("app_user_id")
    private Long appUserId;

    @Schema(description = "设备类型ID")
    @TableField("device_type_id")
    private Integer deviceTypeId;

    @Schema(description = "设备ID")
    @TableField("device_id")
    private Long deviceId;

    @Schema(description = "设备唯一编码")
    @TableField("imei")
    private String imei;

    @Schema(description = "状态是否禁用(0否1是)")
    @TableField("is_disabled")
    private Integer isDisabled;

    @Schema(description = "设备是否在线(0否1是)")
    @TableField("is_online")
    private Integer isOnline;

    @Schema(description = "是否绑定")
    @TableField("is_binding")
    private Integer isBinding;

    @Schema(description = "经度")
    @TableField("longitude")
    private String longitude;

    @Schema(description = "纬度")
    @TableField("latitude")
    private String latitude;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

    @Schema(description = "创建者")
    @TableField("created_by")
    private String createdBy;
}
